#!/usr/bin/env bash

# set -e: exit asap if a command exits with a non-zero status
# set -x: print each command right before it is executed
set -xe

if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
  brew install hub
else
  mkdir -p tmp_hub
  cd tmp_hub

  wget -nv -O hub.tgz "https://github.com/github/hub/releases/download/v2.3.0-pre10/hub-linux-amd64-2.3.0-pre10.tgz"
  tar -xvzf hub.tgz
  ./hub*/bin/hub --version
  sudo mv hub*/bin/hub /usr/bin/

  cd ..
  rm -rf tmp_hub
fi
